<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
</html>
<script>
  var y = 123;
  console.log(parseInt(y / 100));
  console.log(parseInt((y % 100) / 10)); //十位 parseInt（z/10）%10
  console.log(y % 10); //个位
</script>
